package com.joker.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截资源
 *
 * @Author JokerKS
 * @Date 2021/12/06 15:19
 * @Version 1.0
 */

@Configuration
public class ControllerConfig implements WebMvcConfigurer {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new LoginInterceptor())
				.addPathPatterns("/admin/**")
				.excludePathPatterns("/admin")
				.excludePathPatterns("/admin/login");
	}
}
